﻿using NetCoreBBS.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NetCoreBBS.ViewModels
{
    public class TopicNodeViewModel
    {
        public int ParentId { get; set; }

        public int Id { get; set; }

        public string Image { get; set; }

        public string Name { get; set; }

        public string NodeName { get; set; }

        public string Description { get; set; }

        public int TopicCount { get; set; }

        public int Order { get; set; }

        public static TopicNodeViewModel ToModel(TopicNode entity)
        {
            return new TopicNodeViewModel
            {
                ParentId = entity.ParentId,
                Id = entity.Id,
                Image = entity.Image,
                Name = entity.Name,
                NodeName = entity.NodeName,
                Description = entity.Description,
                Order = entity.Order
            };

        }
    }
}
